//
//  ZNClusterMapView.h
//  BaiduCluster
//
//  Created by LiZNing on 14-4-2.
//  Copyright (c) 2014年 lzning. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BMapKit.h"
#import "ZNMapCluster.h"
#import "ZNClusterAnnotation.h"


@class ZNClusterMapView;
@protocol ZNClusterMapViewDelegate <BMKMapViewDelegate>
@optional
- (NSInteger)numberOfClustersInMapView:(ZNClusterMapView *)mapView; // default: 32
- (BMKAnnotationView *)mapView:(ZNClusterMapView *)mapView viewForClusterAnnotation:(id <BMKAnnotation>)annotation; // default: same as returned by mapView:viewForAnnotation:
- (BOOL)shouldShowSubtitleForClusterAnnotationsInMapView:(ZNClusterMapView *)mapView; // default: YES
- (double)clusterDiscriminationPowerForMapView:(ZNClusterMapView *)mapView; // This parameter emphasize the discrimination of annotations which are far away from the center of mass. default: 1.0 (no discrimination applied)
- (NSString *)clusterTitleForMapView:(ZNClusterMapView *)mapView; // default : @"%d elements"
- (void)clusterAnimationDidStopForMapView:(ZNClusterMapView *)mapView;
- (void)mapViewDidFinishClustering:(ZNClusterMapView *)mapView;
@end

@interface ZNClusterMapView : BMKMapView <BMKMapViewDelegate>

- (ZNClusterAnnotation *)clusterAnnotationForOriginalAnnotation:(id<BMKAnnotation>)annotation; // returns the ADClusterAnnotation instance containing the annotation originally added.
- (void)selectClusterAnnotation:(ZNClusterAnnotation *)annotation animated:(BOOL)animated;
- (void)setAnnotations:(NSArray *)annotations;
@property (nonatomic, readonly) NSArray * displayedAnnotations;

@end
